// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   TreeNavigationDTO.java

package com.hfstu.ifs.dto;

import com.hfstu.framework.util.StringUtil;
import com.hfstu.ifs.model.*;
import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.util.Date;
import org.apache.commons.beanutils.BeanUtils;

public class TreeNavigationDTO
	implements Serializable
{

	private String id;
	private Integer status;
	private Date createTime;
	private Date lastChangeTime;
	private String appId;
	private String code;
	private String name;
	private String icon;
	private String iconHover;
	private Integer hide;
	private String parentId;
	private Integer orderIndex;
	private String helpUrl;
	private String description;
	private String funcBindTag;
	private String funcDefId;
	private String funcDefName;
	private String url;
	private String target;
	private String navControlId;
	private String nodeType;

	public TreeNavigationDTO()
	{
		status = Integer.valueOf(0);
		nodeType = "TreeNavigation";
	}

	public String getNavControlId()
	{
		return navControlId;
	}

	public void setNavControlId(String navControlId)
	{
		this.navControlId = navControlId;
	}

	public String getId()
	{
		return id;
	}

	public void setId(String id)
	{
		this.id = id;
	}

	public Integer getStatus()
	{
		return status;
	}

	public void setStatus(Integer status)
	{
		this.status = status;
	}

	public Date getCreateTime()
	{
		return createTime;
	}

	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}

	public Date getLastChangeTime()
	{
		return lastChangeTime;
	}

	public void setLastChangeTime(Date lastChangeTime)
	{
		this.lastChangeTime = lastChangeTime;
	}

	public String getAppId()
	{
		return appId;
	}

	public void setAppId(String appId)
	{
		this.appId = appId;
	}

	public String getCode()
	{
		return code;
	}

	public void setCode(String code)
	{
		this.code = code;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public String getIcon()
	{
		return icon;
	}

	public void setIcon(String icon)
	{
		this.icon = icon;
	}

	public String getIconHover()
	{
		return iconHover;
	}

	public void setIconHover(String iconHover)
	{
		this.iconHover = iconHover;
	}

	public Integer getHide()
	{
		return hide;
	}

	public void setHide(Integer hide)
	{
		this.hide = hide;
	}

	public String getParentId()
	{
		return parentId;
	}

	public void setParentId(String parentId)
	{
		this.parentId = parentId;
	}

	public Integer getOrderIndex()
	{
		return orderIndex;
	}

	public void setOrderIndex(Integer orderIndex)
	{
		this.orderIndex = orderIndex;
	}

	public String getHelpUrl()
	{
		return helpUrl;
	}

	public void setHelpUrl(String helpUrl)
	{
		this.helpUrl = helpUrl;
	}

	public String getDescription()
	{
		return description;
	}

	public void setDescription(String description)
	{
		this.description = description;
	}

	public String getFuncBindTag()
	{
		return funcBindTag;
	}

	public void setFuncBindTag(String funcBindTag)
	{
		this.funcBindTag = funcBindTag;
	}

	public String getUrl()
	{
		return url;
	}

	public void setUrl(String url)
	{
		this.url = url;
	}

	public String getTarget()
	{
		return target;
	}

	public void setTarget(String target)
	{
		this.target = target;
	}

	public String getFuncDefId()
	{
		return funcDefId;
	}

	public void setFuncDefId(String funcDefId)
	{
		this.funcDefId = funcDefId;
	}

	public String getFuncDefName()
	{
		return funcDefName;
	}

	public void setFuncDefName(String funcDefName)
	{
		this.funcDefName = funcDefName;
	}

	public String getNodeType()
	{
		return nodeType;
	}

	public void setNodeType(String nodeType)
	{
		this.nodeType = nodeType;
	}

	public TreeNavigationDTO transfer(TreeNavigation menu)
	{
		try
		{
			BeanUtils.copyProperties(this, menu);
		}
		catch (IllegalAccessException e)
		{
			e.printStackTrace();
		}
		catch (InvocationTargetException e)
		{
			e.printStackTrace();
		}
		if (menu.getFuncDef() != null)
		{
			setFuncDefId(menu.getFuncDef().getId());
			setFuncDefName(menu.getFuncDef().getName());
		}
		if (menu.getNavControl() != null)
			setNavControlId(menu.getNavControl().getId());
		return this;
	}

	public String toJson()
	{
		StringBuilder json = new StringBuilder();
		json.append("{");
		json.append("\"id\":\"").append(getId()).append("\",");
		json.append("\"code\":\"").append(getCode()).append("\",");
		json.append("\"name\":\"").append(getName()).append("\",");
		json.append("\"icon\":\"").append(StringUtil.clean(getIcon())).append("\",");
		json.append("\"iconHover\":\"").append(StringUtil.clean(getIconHover())).append("\",");
		json.append("\"hide\":").append(getHide()).append(",");
		json.append("\"parentId\":\"").append(getParentId()).append("\",");
		json.append("\"orderIndex\":").append(getOrderIndex()).append(",");
		json.append("\"helpUrl\":\"").append(StringUtil.clean(getHelpUrl())).append("\",");
		json.append("\"description\":\"").append(StringUtil.clean(getDescription())).append("\",");
		json.append("\"funcBindTag\":\"").append(StringUtil.clean(getFuncBindTag())).append("\",");
		json.append("\"funcDefId\":\"").append(StringUtil.clean(getFuncDefId())).append("\",");
		json.append("\"funcDefName\":\"").append(StringUtil.clean(getFuncDefName())).append("\",");
		json.append("\"url\":\"").append(StringUtil.clean(getUrl())).append("\",");
		json.append("\"target\":\"").append(StringUtil.clean(getTarget())).append("\",");
		json.append("\"nodeType\":\"").append(getNodeType()).append("\"");
		json.append("}");
		return json.toString();
	}
}
